Function Reference

_IELinkGetCollection

Returns a collection object containing all links in the document or a single link by index.

#include <IE.au3>
_IELinkGetCollection ( ByRef $o_object [, $i_index = -1] )

 

Parameters

$o_object Object variable of an InternetExplorer.Application, Window or Frame object
$i_index Optional: specifies whether to return a collection or indexed instance
0 or positive integer returns an indexed instance
-1 = (Default) returns a collection

 

Return Value

Success: Returns an object collection of all links in the document, @EXTENDED = link count
Failure: Returns 0 and sets @ERROR
@Error: 0 ($_IEStatus_Success) = No Error
3 ($_IEStatus_InvalidDataType) = Invalid Data Type
5 ($_IEStatus_InvalidValue) = Invalid Value
7 ($_IEStatus_NoMatch) = No Match
@Extended: Contains invalid parameter number

 

Remarks

Not all elements that appear to be links actually are. It is common practice to attach onClick JavaScript events to other DOM elements to simulate the behavior of links. To activate such elements, use "click" with _IEAction.

 

Related

None.

 

Example


; *******************************************************
; Example 1 - Open browser with basic example, get link collection,
;               loop through items and display the associated link URL references
; *******************************************************
;
#include <IE.au3>
$oIE = _IE_Example ("basic")
$oLinks = _IELinkGetCollection ($oIE)
$iNumLinks = @extended
MsgBox(0, "Link Info", $iNumLinks & " links found")
For $oLink In $oLinks
    MsgBox(0, "Link Info", $oLink.href)
Next